package com.yishun.springboot.util;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Component
public class GwsRedisUtil {

	@Resource
	RedisUtils redisUtils;

	public Boolean setCraneElectrify(String suffixKey, Integer operation) {

		if (StringUtils.isEmpty(suffixKey) || operation == null) {
			return false;
		}

		String key = "gws.crane.electrify" + suffixKey;

		return redisUtils.set(key, operation);
	}

	public Object getCraneElectrify(String suffixKey) {

		if (StringUtils.isEmpty(suffixKey)) {
			return null;
		}

		String key = "gws.crane.electrify" + suffixKey;

		return redisUtils.get(key);
	}

}
